//
//  ApiRequestUtil.h
//  MXApp
//
//  Created by CC on 2019/6/1.
//  Copyright © 2019 Shanghai YingXiang Network Technology Co., Ltd. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "RequestConstants.h"

@class CCRequestData, CCResponseData;
@class LcApiError;

typedef void (^CKSuccessHandler)(__kindof CCRequestData* requestData, id responseData);
typedef void (^CKApiErrorHandler)(__kindof CCRequestData* requestData, LcApiError* apiError);

@interface ApiRequestUtil : NSObject

// all handlers are called on the main thread
+ (void)sendRequest:(CCRequestData*)requestData
               successHandler:(CKSuccessHandler)successHandler
                 errorHandler:(CKApiErrorHandler)errorHandler
    showModalLoadingIndicator:(BOOL)showModalLoadingIndicator;

@end
